﻿@{
    Layout = null;
}


<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
    <script src="~/Scripts/jquery-1.8.2.js"></script>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>login</title>
    <link href="~/HTML5星空夜空背景登录界面模板/css/normalize.css" rel="stylesheet" />
    <link href="~/HTML5星空夜空背景登录界面模板/css/demo.css" rel="stylesheet" />
    <!--必要样式-->
    <link href="~/HTML5星空夜空背景登录界面模板/css/component.css" rel="stylesheet" />
    <!--[if IE]>
    <script src="js/html5.js"></script>
    <![endif]-->
</head>
<body>
    <div class="container demo-1">
        <div class="content">
            <div id="large-header" class="large-header">
                <canvas id="demo-canvas"></canvas>
                <div class="logo_box">
                    <h3>人力资源管理系统</h3>

                    <form action="#" name="f" method="post">
                        <div class="input_outer">
                            <span class="u_user"></span>
                            <input id="name" class="text" style="color: #FFFFFF !important" type="text" placeholder="请输入账户">
                        </div>
                        <div class="input_outer">
                            <span class="us_uer"></span>
                            <input id="pass" class="text" style="color: #FFFFFF !important; position:absolute; z-index:100;" value="" type="password" placeholder="请输入密码">
                        </div>

                        <div class="mb2"><a class="act-but submit" href="javascript:void(0)" onclick="validate()" style="color: #FFFFFF">登录</a>
                      
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div><!-- /container -->

    <script src="~/HTML5星空夜空背景登录界面模板/js/TweenLite.min.js"></script>

    <script src="~/HTML5星空夜空背景登录界面模板/js/EasePack.min.js"></script>

    <script src="~/HTML5星空夜空背景登录界面模板/js/rAF.js"></script>
    <script src="~/HTML5星空夜空背景登录界面模板/js/demo-1.js"></script>

</body>
</html>
<script>
 
    function validate() {
        var name = $("#name").val();
        var pass = $("#pass").val();
        if(name.length == 0)
        {
            alert('用户名不能为空！');
            location.href = "/Home/Index";
        }
        else
        {
            if(pass.length == 0)
            {
                alert('密码不能为空！');
                location.href = "/Home/Index";
            }
            else
            {
                $.ajax({
                    url: "/Home/usershowpd",
                    type: "post",
                    data: { userName: name, userPass: pass },
                    success: function (obj) {
                        if (obj.length > 0) {
                            if (obj[0].userState == "离职" || obj[0].userState == "等待入职") {
                                alert('您暂时不具备登录权限！');
                                location.href = "/Home/Index";
                            }
                            else {
                                if (obj[0].userDel == 0) {
                                    alert('您的账户已被冻结，请联系管理员解冻。！');
                                    location.href = "/Home/Index";
                                }
                                else {
                                    location.href = "/XBK/Renyuandangan";
                                }
                            }
                        }
                        else {
                            alert('用户名或密码错误!');
                            location.href = "/Home/Index";
                        }
                    }
                })
                }
        }
    }
     
    //    if (name.length == 0) {
    //        alert("用户名不能为空");
    //        location.href = "/Home/Index";
    //    }
    //    else {

    //        if (pass.length == 0) {
    //            alert("密码不能为空！");
    //            location.href = "/Home/Index";
    //        } 
    //        else {
      
    //            })
              
    //        }
    //    }
    //}

</script>
